package com.wclass.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 课程订单
 * </p>
 *
 * @author 张浩高
 * @since 2018-12-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("coures_order")
@SuppressWarnings("serial")
public class CouresOrder extends SuperEntity<CouresOrder> {

    /**
     * 订单号
     */
    @ApiModelProperty("订单号")
    @TableField("order_no")
    private String orderNo;

    /**
     * 是否删除 0：有效，1：删除
     */
    @JSONField(serialize = false)
    @TableLogic
    private Integer state = 0;
    /**
     * 课程id
     */
    @ApiModelProperty("课程id")
    @TableField("course_info_id")
    private Long courseInfoId;
    /**
     * 开课老师id
     */
    @ApiModelProperty("开课老师id")
    @TableField("user_id")
    private Long userId;

    /**
     * 支付金额
     */
    @ApiModelProperty("支付金额(单位分)")
    private Long amount;
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remarks;
    /**
     * 支付状态(0：等待支付，1：支付成功，2：退款中，3：已退款，4：交易关闭)
     */
    @ApiModelProperty("支付状态(0：等待支付，1：支付成功，2：退款中，3：退款成功，4：交易关闭)")
    @TableField("pay_state")
    private Integer payState;
    /**
     * 支付时间
     */
    @ApiModelProperty("支付时间")
    @TableField("pay_time")
    private Date payTime;
    /**
     * 支付平台(0:安卓，1:ios)
     */
    @ApiModelProperty("支付平台(0:安卓，1:ios)")
    @TableField("pay_terrace")
    private Integer payTerrace;

    /**
     * 支付方式(0:支付宝，1:微信)
     */
    @ApiModelProperty("支付方式(0:支付宝，1:微信)")
    @TableField("pay_method")
    private Integer payMethod;

    /**
     * 购买人id
     */
    @ApiModelProperty("购买人Id")
    @TableField("pay_person_id")
    private Long payPersonId;
    /**
     * 评分
     */
    @ApiModelProperty("评分")
    private Integer score;
    /**
     * 评价内容
     */
    @ApiModelProperty("评价内容")
    private String evaluate;
    /**
     * 评价状态，0：未评价，1：已评价
     */
    @ApiModelProperty("评价状态，0：未评价，1：已评价")
    @TableField("evaluate_state")
    private Integer evaluateState;
    /**
     * 评价标签（json存储）
     */
    @ApiModelProperty("评价标签（json存储）")
    @TableField("evaluate_label")
    private String evaluateLabel;
    /**
     * 评价时间
     */
    @ApiModelProperty("评价时间")
    @TableField("evaluate_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date evaluateTime;


    @ApiModelProperty("下单人昵称")
    @TableField(value = "nick_name", exist = false)
    private String nickName;

    @ApiModelProperty("下单人头像")
    @TableField(value = "picture_address", exist = false)
    private String pictureAddress;

    @ApiModelProperty("下单人真实姓名")
    @TableField(value = "user_name", exist = false)
    private String userName;

    @ApiModelProperty("课程封面图片地址")
    @TableField(value = "cover_img_url", exist = false)
    private String coverImgUrl;

    @ApiModelProperty("课程名称")
    @TableField(value = "course_name", exist = false)
    private String courseName;

    @ApiModelProperty("课程综合评分")
    @TableField(value = "course_star", exist = false)
    private String courseStar;

    @ApiModelProperty("课程老师昵称")
    @TableField(value = "teacher_nick_name", exist = false)
    private String teacherNickName;

    @ApiModelProperty("课程老师姓名")
    @TableField(value = "teacher_user_name", exist = false)
    private String teacherUserName;

    @ApiModelProperty("群内状态 0 正常 1 禁言")
    @TableField(value = "group_state")
    private Integer groupState;

    @ApiModelProperty("申诉状态，0：未申诉，1：已申诉")
    @TableField(value = "feedback_state")
    private Integer feedbackState;

    @ApiModelProperty("结算状态，0：未结算，1：待结算，2：已结算")
    @TableField(value = "settlement_state")
    private Integer settlementState;

    @ApiModelProperty("服务费用")
    @TableField(value = "serve_money")
    private BigDecimal serveMoney;

    @ApiModelProperty("退款费用")
    @TableField(value = "refund_money")
    private BigDecimal refundMoney;

    @ApiModelProperty("结算费用")
    @TableField(exist = false)
    private BigDecimal settleMoney;

    @ApiModelProperty("群身份，0：成员，1：管理")
    @TableField(value = "course_identity")
    private Integer courseIdentity;

}
